import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        while(in.hasNextLine()) {
            String str = in.nextLine();
            StringBuilder ret = new StringBuilder();
            StringBuilder cur = new StringBuilder();
            int i = 0;
            for (; i < str.length(); i++) {
                char ch = str.charAt(i);
                if(ch >= '0' && ch <='9') {
                    cur.append(ch);
                }else {
                    if(ret.length() < cur.length()) {
                        ret = cur;
                    }
                    cur = new StringBuilder();
                }
            }
            if(i == str.length() && ret.length() < cur.length()) {
                ret = cur;
            }
            System.out.println(ret);
        }
    }
    public int MoreThanHalfNum_Solution(int [] array) {
        int size = array.length / 2;
        int ret = array[0];
        for (int i = 0; i < array.length; i++) {
            int cur = array[i];
            int count = 0;
            for (int j = i; j < array.length; j++) {
                if(array[i] == array[j]) {
                    count++;
                }
            }
            if(count > size) {
                ret = array[i];
            }
        }
        return ret;
    }
    public int MoreThanHalfNum_Solution2(int [] array) {
        if (array == null || array.length == 0) {
            return 0;
        }
        Arrays.sort(array);
        int len = array.length;
        int midNum = array[len / 2];
        int count = 0;
        for (int i = 0; i < len; i++) {
            if (array[i] == midNum) {
                count++;
            }
        }
        if (count > len / 2) {
            return midNum;
        }
        return 0;
    }
    public int MoreThanHalfNum_Solution3(int [] array) {
        if (array == null || array.length == 0) {
            return 0;
        }
        int result = array[0];
        int times = 1;
        for (int i = 1; i < array.length; i++) {
            if(times != 0) {
                if(array[i] == result) {
                    times++;
                }else {
                    times--;
                }
            }else {
                result = array[i];
                times = 1;
            }
        }
        times = 0;
        for (int i = 0; i < array.length; i++) {
            if(array[i] == result) {
                times++;
            }
        }
        return (times > array.length/2) ? result : 0;
    }
}
